/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.startup.musicstore.app.factory;

import com.startup.musicstore.model.Album;
import com.startup.musicstore.model.MarketingInformation;
import com.startup.musicstore.model.Track;
import java.math.BigDecimal;

/**
 *
 * @author Administrator
 */
public class AlbumFactory {
    
    public static class Builder {
        private String albumTitle;
        private BigDecimal unitPrice;
        private int inventory;
        private int sales;
        private MarketingInformation statusOfInformation;
        private Track trackNumber;
        private String trackTitle;
        
        public Builder(String albumTitle) {
            this.albumTitle = albumTitle;            
        }
        
        public Builder TrackNumber(Track trackNumber) {
            this.trackNumber = trackNumber;
            return this;
        }
        
        public Builder TrackTitle(String trackTitle) {
            this.trackTitle = trackTitle;
            return this;
        }
        
        public Builder AlbumTitle(String albumTitle) {
            this.albumTitle = albumTitle;
            return this;
        }
        
        public Builder StatusOfInformation(MarketingInformation statusOfInformation) {
            this.statusOfInformation = statusOfInformation;
            return this;
        }
        
        public Builder UnitPrice(BigDecimal unitPrice) {
            this.unitPrice = unitPrice;
            return this;
        }
        
        public Builder Inventory(int inventory) {
            this.inventory = inventory;
            return this;
        }
        
        public Builder Sales(int sales) {
            this.sales = sales;
            return this;
        }
        
        public Album build() {
            return getAlbum(this);
        }
        
        public Album getAlbum(Builder builder) {
            Album album = new Album();
            album.setAlbumTitle(builder.albumTitle);
            album.setUnitPrice(builder.unitPrice);
            album.setInventory(builder.inventory);
            album.setSales(builder.sales);
            return album;
        }
        
    }
    
}
